<?php

namespace app\admin\model\sum;

use think\Model;
use traits\model\SoftDelete;

class Richtext extends Model
{

    use SoftDelete;

    

    // 表名
    protected $name = 'sum_richtext';
    
    // 自动写入时间戳字段
    protected $autoWriteTimestamp = 'integer';

    // 定义时间戳字段名
    protected $createTime = 'createtime';
    protected $updateTime = 'updatetime';
    protected $deleteTime = 'deletetime';

    // 追加属性
    protected $append = [

    ];

    public function getTypeList()
    {
        return [
            'normal' => __('Normal'),
            'other' => __('Other'),
        ];
    }

    public function getSlugList()
    {
        return [
            'agency' => __('Slug_agency'),
        ];
    }


    public function getTypeTextAttr($value, $data)
    {
        $value = $value ? $value : (isset($data['type']) ? $data['type'] : '');
        $list = $this->getTypeList();
        return isset($list[$value]) ? $list[$value] : '';
    }
    

    







}
